home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-04-08 | 1.4 KB | 48 lines | [TEXT/ToyS] |
- property dNames : ["Done", "Add…", "Add…", "Add…", "Add…", "Add…", "Add…", "Add…", "Add…", "Add…", "Add…", "Add…"]
- property dDocs : [0, null, null, null, null, null, null, null, null, null, null, null]
- property dBounds : null
-
- on run
- dd install with floating
- if dBounds = null then set dBounds to dd calc dialog bounds [405, 68]
- dd make dialog {bounds:dBounds, contents:[¬
- B(1), B(2), B(3), B(4), B(5), B(6), ¬
- B(7), B(8), B(9), B(10), B(11), B(12) ¬
- ], font:{name:"Helvetica", size:9}, style:sideways palette, name:"Documents"}
- repeat
- try
- if DoAction(dd interact with user) then exit repeat
- on error number err
- if err ≠ -128 then exit repeat
- end try
- end repeat
- set dBounds to last item of (dd get value of every item of dialog 1)
- dd uninstall
- end run
-
- on R(i)
- set x to 5 + (i mod 4) * 100
- set y to 5 + (i div 4) * 21
- return [x, y, x + 95, y + 16]
- end R
-
- on B(i)
- return {class:push button, bounds:R(i - 1), name:item i of dNames}
- end B
-
- on DoAction(i)
- if i = 1 then return true
- if item i of dDocs = null then
- activate
- set doc to choose file with prompt "Select a document:"
- set AppleScript's text item delimiters to [":"]
- set n to last text item of (doc as string)
- set AppleScript's text item delimiters to ""
- dd set name of item i of dialog 1 to n
- set item i of dNames to n
- set item i of dDocs to doc
- else
- tell application "Finder" to open item i of dDocs
- end if
- return false
- end DoAction